package com.apartment.es.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 作者：陈学虎
 * 时间：2021/8/3 0003 下午 2:07
 */
@Data
@Document(indexName = "es-rooms",shards = 1,replicas = 0)
public class ESRooms {

    //三个维度
    //1:要不要分词，分词效果   type、analyzer
    //2:要不要建立索引 index
    //3:要不要存储  store
    @Id
    private Integer roomId;   //房间id

    @Field(type = FieldType.Text, analyzer = "ik_max_word",store=true)
    private String roomName;  //房间名称

    @Field(type = FieldType.Keyword,store = true)
    private String areaName; //区域

    @Field(type = FieldType.Keyword,store = true)
    private String roomSubway;  //地铁线路

    @Field(type = FieldType.Text,store = true)
    private String roomTraffic; //交通

    @Field(type = FieldType.Keyword,store = true)
    private String roomFeatures; //房间特色

    @Field(type = FieldType.Text,store = true)
    private String roomDetailFloor;  //楼层

    @Field(type = FieldType.Integer,store = true)
    private Integer roomDetailArea; //面积

    @Field(type = FieldType.Text,store = true)
    private String roomDetailAddress; //具体地址

    @Field(type = FieldType.Keyword,store = true)
    private String roomDetailToward; //朝向

    @Field(type = FieldType.Integer,store = true)
    private Integer roomPrice;  //房间租金

    @Field(type = FieldType.Keyword,index = false,store=true)
    private String roomPic; //房间展示图

}
